<?php
/**
 *
 * Author: LiuJianPeng
 * Date: 2023/8/7
 * Time: 14:03
 */

namespace App\Service\Core\Sys\Area;

use App\Model\Core\Sys\SysAreaModel;
use App\Service\Core\CoreBaseService;
use App\Traits\SingleInstanceTrait;

class SysAreaService extends CoreBaseService
{

    use SingleInstanceTrait;

    /**
     * 根据父级ID获取列表
     * @param int $parent_id
     * @return array
     */
    public function getListByParentId(int $parent_id = 0): array
    {
        return SysAreaModel::getInstance()->getAllByParentId($parent_id);
    }

    public function getOne(int $area_id,bool $cache = true):array
    {
        return SysAreaModel::getInstance()->getOne($area_id,$cache);
    }
}
